/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package org.refunite.mobile.s60.widget;

import java.util.Vector;
import javax.microedition.lcdui.ChoiceGroup;
import javax.microedition.lcdui.Image;

/**
 *
 * @author I040022
 */
public class CustomChoiceGroup extends ChoiceGroup {

    private Vector itemVector;
    private Vector valueVector;
    public CustomChoiceGroup(String aLabel, int aChoiceType) {
        super(aLabel, aChoiceType);
        itemVector = new Vector();
        valueVector = new Vector();
    }

    public int append(String aStringElement, Image aImageElement, String valueItem) {
        itemVector.addElement(aStringElement);
        valueVector.addElement(valueItem);
        return super.append(aStringElement, aImageElement);
    }

    public String getSelectedItem(){
        int selectedIndex = super.getSelectedIndex();
        return (String)valueVector.elementAt(selectedIndex);
    }

}
